#ifndef HYPERSPINMODEL_H
#define HYPERSPINMODEL_H

#include <QAbstractItemModel>
#include <QSet>
#include "hyperspin.h"

class HyperspinModel : public QAbstractItemModel
{
  Q_OBJECT

  QVector<hs::Entry> _entries;
  QSet<QString> _favorites;
  QString _system;
public:
  explicit HyperspinModel(const QString& system, QObject *parent = 0);

  QModelIndex index(int row, int column, const QModelIndex &parent) const;
  QModelIndex parent(const QModelIndex &) const;
  int rowCount(const QModelIndex &parent) const;
  int columnCount(const QModelIndex &parent) const;
  QVariant data(const QModelIndex &index, int role) const;
  QString system() const;
  void refreshFavorites();

  int favoritesCount() const;

signals:

public slots:
  void setSystem(const QString& system);
  void setFavorite(const QString& name, bool fav);
};

#endif // HYPERSPINMODEL_H
